package com.muli.muwai.demo;

import com.google.common.collect.Lists;


import java.awt.print.Book;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;

public class demo1 {
    public static void main(String[] args) throws ParseException {

       /* Date today = new Date(System.currentTimeMillis() - 1000 * 60 * 60 * 24);
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
        String yesterday = simpleDateFormat.format(today);//获取昨天日期
        System.out.println(yesterday);*/
        /*ArrayList<String> list = new ArrayList<>();
        if(list.size()==0){
            System.out.println("nihao");
        }*/
        /*String s = "2021-04-09 22:12:48";
        SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Date date=sdf.parse("2002-10-8 15:30:22");
        System.out.println(date);*/
       /* List<String> list = new ArrayList<String>();
        list.add("1");
        list.add("2");
        list.add("3");

        System.out.println(list.toString());
        System.out.println(StringUtils.strip(list.toString(),"[]"));*/
       /* Calendar c = Calendar.getInstance(); //这句好像很浪费，我也不知道该怎么处理
        System.out.println(c);
        c.setTime(date);//将Date或Timestamp放进去
        System.out.println(c.get(Calendar.YEAR));    //取出年份
        System.out.println(c.get(Calendar.MONTH) + 1); //取出月份，要加1，因为是从0开始的(!)不知道为什么Sun要这样?
        System.out.println(c.get(Calendar.DATE));    //取出日期*/
       /* HashSet<String> set = new HashSet<>();
        set.add("1月");
        set.add("1月");
        String strip = StringUtils.strip(set.toString(), "[]");
        System.out.println(strip);
        int i = Integer.parseInt(strip);
        System.out.println(set.toString());*/

       /* List<Booke> list = Lists.newArrayList();

        list.add(new Booke("1", "sql基础大全", 200));
        list.add(new Booke("2", "Java基础", 500));
        List<String> nameList = list.stream().map(Book -> Book.getNum()).collect(Collectors.toList());
        System.out.println(nameList);*/

       /* List<Integer> list = new ArrayList<>();
        list.add(9);
        list.add(10);
        list.add(7);
        list.add(5);
        Integer max = Collections.max(list);
        System.out.println(max);*/

      /*  Map<String,String> num=new HashMap<>();
        num.put("jan","1");
        num.put("feb","2");
        num.put("mar","3");
        Iterator<Map.Entry<String, String>> iterator = num.entrySet().iterator();
        while (iterator.hasNext()) {
            Map.Entry<String, String> entry = iterator.next();
            System.out.println("key:" + entry.getKey() + ",value:" + entry.getValue());
        }*/
        //得到昨天的信息
        /*long current=System.currentTimeMillis();//当前时间毫秒数
        //今天时间的零时零分零秒
        long zero=current/(1000*3600*24)*(1000*3600*24)-TimeZone.getDefault().getRawOffset();//今天零点零分零秒的毫秒数
        System.out.println(zero);
        //获取昨天的零时零分零秒
        Calendar c = Calendar.getInstance();
        c.set(Calendar.HOUR_OF_DAY, 0);
        c.set(Calendar.MINUTE, 0);
        c.set(Calendar.SECOND, 0);
        c.set(Calendar.MILLISECOND, 0);
        Long today=c.getTimeInMillis();
        System.out.println(today);
        long yesteday = today - (24 * 60 * 60*1000);
        System.out.println(yesteday);*/


    }

}
